package research.ui.views.comparators;

import org.eclipse.jface.viewers.Viewer;

import research.domain.Application;

public class ApplicationDateComparator extends EntityComparator {

	@Override
	public int compare(Viewer viewer, Object e1, Object e2) {
		if (e1 instanceof Application && e2 instanceof Application) {
			if (isDesc()) {
				Object e = e1;
				e1 = e2;
				e2 = e;
			}
			Application res1 = (Application) e1;
			Application res2 = (Application) e2;
			return res1.getDate().compareTo(res2.getDate());
		}
		return super.compare(viewer, e1, e2);
	}


	
}
